<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>前一个错误信息</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reserved.variables.cookies.html">$_COOKIE</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reserved.variables.httprawpostdata.html">$HTTP_RAW_POST_DATA</a></div>
 <div class="up"><a href="reserved.variables.html">预定义变量</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="reserved.variables.phperrormsg" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">$php_errormsg</h1>
  <p class="refpurpose"><span class="refname">$php_errormsg</span> &mdash; <span class="dc-title">前一个错误信息</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-reserved.variables.phperrormsg-description">
  <h3 class="title">说明</h3>
  <p class="para">
   <var class="varname"><var class="varname">$php_errormsg</var></var> 变量包含由 PHP 生成的最新错误信息。这个变量只在错误发生的作用域内可用，并且要求 <a href="errorfunc.configuration.html#ini.track-errors" class="link">track_errors</a> 配置项是开启的（默认是关闭的）。
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <span class="simpara">
    这个变量仅在 <var class="filename">php.ini</var> 文件中的 <em>track_errors</em> 配置项开启的情况下可用。
   </span>
  </p></blockquote>
  <div class="warning"><strong class="warning">Warning</strong>
   <p class="simpara">
    如果用户定义了错误处理句柄（<span class="function"><a href="function.set-error-handler.html" class="function">set_error_handler()</a></span>）并且返回 <strong><code>FALSE</code></strong> 的时候，<var class="varname"><var class="varname">$php_errormsg</var></var> 就会被设置。
   </p>
  </div>
 </div>

 
 <div class="refsect1 examples" id="refsect1-reserved.variables.phperrormsg-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="variable.phperrormsg.basic">
    <p><strong>Example #1 <var class="varname"><var class="varname">$php_errormsg</var></var> 范例</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">@</span><span style="color: #0000BB">strpos</span><span style="color: #007700">();<br />echo&nbsp;</span><span style="color: #0000BB">$php_errormsg</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程的输出类似于：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Wrong parameter count for strpos()
</pre></div>
    </div>
   </div>
  </p>
 </div>

 
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reserved.variables.cookies.html">$_COOKIE</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reserved.variables.httprawpostdata.html">$HTTP_RAW_POST_DATA</a></div>
 <div class="up"><a href="reserved.variables.html">预定义变量</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
